package test2.iboxdb;

import java.util.function.Consumer;

import iBoxDB.LocalServer.DB;

public class App {
	
	public static void main(String[] args) {
		iBoxDB.LocalServer.DB.root("D:\\iboxdb");
		DB server = new DB();
		server.getConfig().ensureTable(Record.class, "Table", "ID");
		DB.AutoBox auto = server.open();
//		auto.insert("Table", new Record(1, "Andy"));
//		Record o1 = auto.selectKey(Record.class, "Table", 1);
		Iterable<Record> iter = auto.select(Record.class, "from Table");
		iter.forEach(new Consumer<Record>() {
			@Override
			public void accept(Record t) {
				System.out.println(t);
			}
		});
//		o1.Name = "Kelly";
//		auto.update("Table", o1);
//		auto.delete("Table", 1);
//		System.out.println(o1);
		server.close();
	}

}
